﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using FusionDotNet.WorkflowActivities;
using Microsoft.Activities.UnitTesting;
using System.Activities;

namespace FusionDotNet.Tests
{
    [TestClass]
    public class WorkflowTests
    {
        [TestMethod]
        public void TestSelectActivity()
        {
            string commandText = "SELECT 'Store Name', Pharmacy, Hours FROM 292905 WHERE Pharmacy='yes' AND ST_INTERSECTS(Address, CIRCLE(LATLNG(37.3242,-121.9806),5000))";

            var activity = new FusionDotNet.WorkflowActivities.SelectActivity() { Query = commandText };
            var resultTable = WorkflowInvoker.Invoke(activity);

            Assert.IsTrue(resultTable.Rows.Count > 0);


        }
    }
}
